package com.cimu.mybatis.service.impl;

import com.cimu.mybatis.entity.User;
import com.cimu.mybatis.mapper.UserMapper;
import com.cimu.mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Title: UserServiceImpl
 * Copyright: Copyright (c) 2017
 *
 *
 *
 * date 2018年11月23日 18:28
 */
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;

    @Override
    public User getById(Long id) {
        return userMapper.getById(id);
    }

    @Override
    public List<User> selectAll(String realName) {
        User user = new User();
        user.setRealName(realName);
        return userMapper.selectAll(user);
    }

    @Override
    public void deleteById(Long id) {
        userMapper.deleteById(id);
    }

}
